home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 26.zip
/
BS1 part 26
/
C for beginners.adf
/
source
/
stringfunc.c
< prev
next >
Wrap
Text File
|
1978-01-17
|
521b
|
34 lines
/* stringfunc.c 17.1 */
strcpy(to, from)
register char *to, *from;
{
while(*to++ = *from++)
;
}
strlen(s) /* Conversion to pointer! */
register char *s;
{
register char *help = s; /* Store initial position */
while(*s)
s++;
return(s - help);
/* Difference between pointers is Element number */
}
strcmp(s,t)
register char *s, *t;
{
while(*s == *t)
{
if(!*s)
return(0); /* End reached (*s == 0) */
s++;
t++;
}
return(*s - *t); /* Difference between two strings */
}